﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using MarsExplorerWebSite.Model;

namespace MarsExplorerWebSite.Functions
{
    public class addTeam : FunctionBase
    {
        private MarsExplorerEntities dbContext;

        public addTeam(HttpContext context) : base(context)
        {
            InitializeProperties();
        }

        public override string Execute()
        {
            dbContext.Teams.AddObject(new Team { Name = "hello", TeamID = 1 });
            dbContext.SaveChanges();
            Debug.WriteLine("hello");
            return "OK";
        }

        public override void InitializeProperties()
        {
            try
            {
                dbContext = new MarsExplorerEntities();
            }
            catch (Exception e)
            {
                string message = "";
#if DEBUG
                message += " : " + e.ToString();

#endif

               
            }
        }
    }
}